scrolledwindow: Avoid usage of uninitialized local
authorTimm Bäder <mail@baedert.org>
Sat, 18 Feb 2017 09:43:14 +0000 (10:43 +0100)
committerTimm Bäder <mail@baedert.org>
Sat, 18 Feb 2017 18:01:28 +0000 (19:01 +0100)
the scrollbar passed in better be either priv->hscrollbar or
priv->vscrollbar. Ensure that by using a simple else instead of an
else-if and a g_assert.

gtk/gtkscrolledwindow.c

index bc23a13f78edfd12e499a35b315285abd57ced3e..d2c3cbfb2fe7d1a8d153916d0f0680d0aa38af7d 100644 (file)
@@ -3188,8 +3188,10 @@ gtk_scrolled_window_allocate_scrollbar (GtkScrolledWindow *scrolled_window,
       child_allocation.width = content_allocation.width;
       child_allocation.height = sb_height;
     }
-  else if (scrollbar == priv->vscrollbar)
+  else
     {
+      g_assert (scrollbar == priv->vscrollbar);
+
       if ((_gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL &&
           (priv->window_placement == GTK_CORNER_TOP_RIGHT ||
            priv->window_placement == GTK_CORNER_BOTTOM_RIGHT)) ||